<?php
/**
 * Created by PhpStorm.
 * User: godjarvis
 * Date: 2020/08/07
 * Time: 14:25
 */

namespace App\Model\Dao;

use App\Model\Entity\ShareLog;
use Fresh\Facade\Db;
use Fresh\Mvc\Model\Dao;

class ShareLogDao extends Dao
{

    public function get($id)
    {
        return $this->expr()
            ->from(ShareLog::class)
            ->where('id=?', $id)
            ->query()
            ->findFirst();
    }


    public function gets()
    {
        return $this->expr()
            ->from(ShareLog::class)
            ->query()
            ->find();
    }


    public function update($id, $row)
    {
        return Db::update(ShareLog::class, $row, $this->expr()->where('id=?', $id));
    }


    public function insert($row)
    {
        return Db::insert(ShareLog::class, $row);
    }


    public function insertGetId($row)
    {
        return Db::insertGetId(ShareLog::class, $row);
    }


    public function insertAll($rows)
    {
        return Db::insertAll(ShareLog::class, $rows);
    }


    public function insertOrUpdate($row, $columns)
    {
        return Db::insertOrUpdate(ShareLog::class, $row, $columns);
    }
}
